using System;

namespace DemonstrationWebsite.SimpleListDemo
{
    public partial class SimpleListDemoPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TagList.Model["tags"] = new string[] { "Javascript", "MVC", "Goodness" };
            }
        }

        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            // Retrieve updated data model from control
            string[] tags = (string[])TagList.Model["tags"];
            ResultsLabel.Text = string.Format("You entered {0} tag(s): {1}", tags.Length, string.Join(", ", tags));
        }
    }
}
